<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <form action="">
    <input type="text" />
    <button>提交</button>
  </form>

  <script>
    var button = document.querySelector('button')

    button.onclick = function(e) {
      e.preventDefault()   // 组织默认行为

      // return false  // 组织默认行为  黑科技
    }
  </script>
</body>
</html>